package com.whl.sm.vo;

import com.whl.sm.model.assets.ComBuilding;
import com.whl.sm.model.assets.ComUnits;
import com.whl.sm.model.system.OrgUserInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@Data
@NoArgsConstructor
public class WxAssetsDetailVo implements Serializable {

    public WxAssetsDetailVo(ComUnits comUnits, ComBuilding comBuilding){
        if (Objects.nonNull(comUnits)){
            this.id = comUnits.getId();
            this.unitCode = comUnits.getUnitCode();
            this.budId = comUnits.getBudId();
            this.storey = comUnits.getStorey();
            this.unitStatus = comUnits.getUnitStatus();
            this.createTime = comUnits.getCreateTime();
            this.updateTime = comUnits.getUpdateTime();
            this.thumbnail = comUnits.getThumbnail();
            this.operator = comUnits.getOperator();
            this.unitArea = comUnits.getUnitArea();
        }
        if (Objects.nonNull(comBuilding)){
            this.budName = comBuilding.getBudName();
        }

    }

    /**
     * 单元id
     * */
    private String id;

    /**
     * 单元编码
     */
    private String unitCode;

    /**
     * 所属楼栋id
     */
    private String budId;

    /**
     *楼栋名称
     * */
    private String budName;


    /**
     * 楼层数
     */
    private int storey;


    /**
     * 单元使用状态1:已售卖 2:已租赁  0::空闲
     */
    private Integer unitStatus;

    /**
     * 单元面积
     */
    private double unitArea;

    /**
     * 单位模型缩略图
     */
    private String thumbnail;

    /**
     * 创建时间
     */

    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 租赁合同有效期
     * */
    private Date validTime;

    /**
     * 操作者id
     */
    private String operator;


    /**
     * 成员列表
     * */
    private List<OrgUserInfo> memberList;


}
